import unittest

from selenium.webdriver.chrome.webdriver import WebDriver

driver = WebDriver()
driver.find_element()


import ddt

def setUpModule():
    print("set up module trigger")


@ddt.ddt
class TestCase1(unittest.TestCase):
    @classmethod
    def setUpClass(cls) -> None:
        print("全局初始化")

    def setUp(self) -> None:
        print("方法前置处理")

    @unittest.skip('跳过')
    def test_case1(self):
        print("test case1")

    @ddt.unpack
    @ddt.data([1, 1], [2, 2], [3, 3])
    def test_case2(self, val, val2):
        print(f"test case2 {val} {val2}")

    def tearDown(self) -> None:
        print("方法后置处理")

    @classmethod
    def tearDownClass(cls) -> None:
        print("环境清理")


def tearDownModule():
    print("teardown module ======")


if __name__ == '__main__':
    suite = unittest.TestSuite()
    suite.addTest(TestCase1("test_case1"))
    suite.addTest(TestCase1("test_case2"))
    runner = unittest.TextTestRunner()
    runner.run(suite)
